package HanJiaHomeWork;

public class day4_2 {
    /**
     * 丑数
     * @param n
     * @return
     */
    public boolean isUgly(int n) {
        if(n<1){
        return false;
    }
        while(n > 1){
            int t = n;
            while(t%2 ==0) t/=2;
            while(t%3 ==0) t/=3;
            while(t%5 ==0) t/=5;
            if(t == n) return false;
            n = t;
        }
        return true;
    }

    public static void main(String[] args) {

    }
}
